﻿using System;
using MLSharp;
using MLSharp.Classification;

namespace MLSharp.ConsoleRunner
{
	/// <summary>
	/// Predicts "NeedTC" based on the value of 
	/// "EDACS".
	/// </summary>
	public class AcsNeedTcClassifier : IClassifier
	{
		#region Public Methods

		/// <summary>
		/// Predicts the class of the instance.
		/// </summary>
		/// <param name="instance">The instance to classify.</param>
		public ClassificationResult Classify(Instance instance)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Classifies all the instances in the specified data set.
		/// </summary>
		/// <param name="dataSet">The data set to classify.</param>
		/// <returns>The results of classifying each instance.</returns>
		public ClassificationResult[] Classify(IDataSet dataSet)
		{
			ClassificationResult[] results = new ClassificationResult[dataSet.Instances.Count];

			for (int i = 0; i < results.Length; i++)
			{
				ClassificationResult result = new ClassificationResult(dataSet.Instances[i].ClassValue,
				                                                       dataSet.Instances[i].ClassValue);

				result.ID = dataSet.Instances[i].Label;
				result.Confidence = 1.0;

				results[i] = result;
			}

			return results;
		}

		#endregion
	}
}
